package com.siecom.hostservice;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.text.TextUtils;
import android.util.Log;

/**
 * Created by admin on 2018/1/9.
 */

public class USBDiskReceiver extends BroadcastReceiver {
    public SharedPreferences cacheSp;

    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        Log.e("USB action",action);
        String path = intent.getData().getPath();
        if (!TextUtils.isEmpty(path)){
            if ("android.intent.action.MEDIA_UNMOUNTED".equals(action)) {
                Log.d("usb","unmounted");
            }
            if ("android.intent.action.MEDIA_MOUNTED".equals(action)) {
                Log.d("usb","mounted");
            }
        }


    }
}